package org.xlp.db.xml;

import org.xlp.assertion.AssertUtils;

/**
 * Description: 提供获取<code>SQLXmlContextApplication</code>上下文对象工具类
 * <br/>date: 2024/4/16 10:19
 *
 * @version 1.0
 * @author: xlp
 */
public class SQLXmlContextHelper {
    private static SQLXmlContextApplication APPLICATION;

    /**
     * 把SQL xml文件解析上下文放入缓存中，作为后续操作
     * @param application
     * @throws NullPointerException 假如参数为null，则抛出该异常
     */
    public static void put(SQLXmlContextApplication application){
        AssertUtils.isNotNull(application, "application parameter must be not null!");
        APPLICATION = application;
    }

    /**
     * 返回SQL xml文件解析上下文
     * @return
     */
    public static SQLXmlContextApplication getApplication(){
        return APPLICATION;
    }
}
